/**   
 * @Title: CheckBindMobileCommunicater.java 
 * @Package： com.esun.rabbit2.communicaters.myinfo 
 * @Description: 检测是否已绑定手机
 * @Author Miko baoz@500wan.com   
 * @Date 2011-7-3 下午07:37:47  
 * Copyright (C) 2011 Shenzhen E-sun Sky Net Technology Co.,ltd.
 */
package com.esun.rabbit2.communicaters.myinfo;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;

import javax.xml.parsers.ParserConfigurationException;

import org.apache.http.client.ClientProtocolException;
import org.xml.sax.SAXException;

import com.esun.config.BussinessCode;
import com.esun.model.UserInfo;
import com.esun.network.ServerCommunicater;

/**
 * @ClassName: CheckBindMobileCommunicater
 * @Description: 检测是否已绑定手机通讯类
 * @author Miko baoz@500wan.com
 * @date 2011-7-3 下午07:37:47
 * 
 */
public class CheckBindMobileCommunicater extends ServerCommunicater {

	public boolean check() throws ClientProtocolException, IOException, ParserConfigurationException, SAXException {

		ArrayList<HashMap<String, String>> list = new ArrayList<HashMap<String, String>>();

		list.add(mapItem(BussinessCode.PASER_MID, BussinessCode.MID_CHECK_BINDMOBILE));
		list.add(mapItem(BussinessCode.PASER_CK, UserInfo.getUserInfo().getUserSession()));

		super.getServerResponse(list, true);

		if (super.getState() == 100) {
			return true;
		} else {
			return false;
		}
	}

	private HashMap<String, String> mapItem(String name, String value) {
		HashMap<String, String> map = new HashMap<String, String>();
		map.put(name, value);
		return map;
	}

}
